let t = require;
let  e = module
let  o =  e.exports;
 o.default =  e.exports;

                'use strict';
                console.log("start");
                var _n8,
                    i =
                    (this && this.__extends) ||
                    ((_n8 = function n(t, e) {
                            return (_n8 =
                                Object.setPrototypeOf ||
                                ({
                                        __proto__: []
                                    }
                                    instanceof Array &&
                                    function(t, e) {
                                        t.__proto__ = e;
                                    }) ||
                                function(t, e) {
                                    for (var o in e) {
                                        Object.prototype.hasOwnProperty.call(e, o) && (t[o] = e[o]);
                                    }
                                })(t, e);
                        }),
                        function(t, e) {
                            function o() {
                                this.constructor = t;
                            }
                            _n8(t, e),
                                (t.prototype =
                                    null === e ?
                                    Object.create(e) :
                                    ((o.prototype = e.prototype), new o()));
                        });
                Object.defineProperty(o, '__esModule', {
                        value: !0
                    }),
                    (o.AbsAnimation = void 0);
                var r = t('AbsObject'),
                    a = t('ComUtils'),
                    s = t('AbsActor'),
                    c = t('TimeMrg'),
                    l = t('PoolMrg'),
                    u = (function(t) {
                        function e(e) {
                            void 0 === e && (e = null);
                            var o = t.call(this) || this;
                            return (o._entity = e || new cc.Node()), o;
                        }
                        return (
                            i(e, t),
                            Object.defineProperty(e.prototype, 'entity', {
                                get: function get() {
                                    return this._entity;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'model', {
                                get: function get() {
                                    return this._model;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (e.prototype.loadModel = function(t) {
                                if (this._modelUrl != t) {
                                    this._modelUrl = t;
                                    var e = l.PoolMrg.get(t);
                                    e
                                        ?
                                        this.initModel(e) :
                                        cc.resources.load(t, this.loadModelComplete.bind(this));
                                }
                            }),
                            (e.prototype.loadModelComplete = function(t, e) {
                                t ||
                                    (cc.isValid(this.entity) &&
                                        this.initModel(cc.instantiate(e)));
                            }),
                            (e.prototype.initModel = function(t) {
                                t &&
                                    (a.default.setColor(t, this.entity.color),
                                        this._model && this._model.removeFromParent(),
                                        (t.position = cc.Vec3.ZERO),
                                        this.entity.addChild(t),
                                        (this._model = t),
                                        this.initAnimator(t.getComponent(sp.Skeleton)),
                                        this.onInitModel(t),
                                        this.emit(s.ActorEvent.ModelChanged));
                            }),
                            (e.prototype.onInitModel = function() {}),
                            (e.prototype.initAnimator = function(t) {
                                this.removeArmatureListener(),
                                    t &&
                                    (t.setStartListener(this.onAnimStartHandler.bind(this)),
                                        t.setCompleteListener(
                                            this.onAnimLoopCompleteHandler.bind(this)
                                        ),
                                        t.setEndListener(this.onAnimCompleteHandler.bind(this)),
                                        t.setEventListener(this.onAnimEventHandler.bind(this)),
                                        (t.timeScale = this._animSpeed),
                                        (this._animator = t),
                                        c.TimeMrg.timer.delayCall(this.playLastAnim, this, 0.1));
                            }),
                            (e.prototype.removeArmatureListener = function() {
                                null != this._animator &&
                                    (this._animator.setStartListener(null),
                                        this._animator.setCompleteListener(null),
                                        this._animator.setEndListener(null),
                                        this._animator.setEventListener(null));
                            }),
                            (e.prototype.playLastAnim = function() {
                                null != this._animName &&
                                    this.playAnim(this._animName, this._playTimes);
                            }),
                            (e.prototype.onAnimStartHandler = function(t) {
                                0 == t.trackIndex && this.emit(s.ActorEvent.ArmatureStart, t);
                            }),
                            (e.prototype.onAnimLoopCompleteHandler = function(t) {
                                0 == t.trackIndex &&
                                    (this._playTimes > 0 &&
                                        (this._playTimes--,
                                            0 == this._playTimes &&
                                            (this._animState && (this._animState.loop = !1),
                                                (this._animator.loop = !1))),
                                        this.emit(s.ActorEvent.ArmatureLoopComplete, t));
                            }),
                            (e.prototype.onAnimEventHandler = function(t) {
                                0 == t.trackIndex && this.emit(s.ActorEvent.ArmatureEvent, t);
                            }),
                            (e.prototype.onAnimCompleteHandler = function(t) {
                                0 == t.trackIndex &&
                                    this.emit(s.ActorEvent.ArmatureComplete, t);
                            }),
                            (e.prototype.playAnim = function(t, e, o) {
                                return (
                                    void 0 === e && (e = -1),
                                    void 0 === o && (o = !1),
                                    null != t &&
                                    (this._animator ?
                                        this._animator.findAnimation(t) &&
                                        (this._animator.animation != t || o) &&
                                        ((this._animator.loop = 1 != e),
                                            (this._animState = this._animator.setAnimation(
                                                0,
                                                t,
                                                this._animator.loop
                                            )),
                                            (this._animName = t),
                                            this._animState &&
                                            1 == e &&
                                            (this._animState.loop = !1)) :
                                        (this._animName = t),
                                        (this._playTimes = e)),
                                    this._animState
                                );
                            }),
                            Object.defineProperty(e.prototype, 'animSpeed', {
                                get: function get() {
                                    return this._animSpeed;
                                },
                                set: function set(t) {
                                    this._animator && (this._animator.timeScale = t),
                                        (this._animSpeed = t);
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            Object.defineProperty(e.prototype, 'isValid', {
                                get: function get() {
                                    return !!t.prototype.isValid && null != this._entity;
                                },
                                enumerable: !1,
                                configurable: !0
                            }),
                            (e.prototype.onDestroy = function() {
                                this._model &&
                                    (l.PoolMrg.put(this._modelUrl, this._model),
                                        (this._model = null)),
                                    t.prototype.onDestroy.call(this);
                            }),
                            e
                        );
                    })(r.AbsObject);
                (o.AbsAnimation = u), console.log("end");
            module.exports =  e.exports;